<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<%@include file="../../common/common.jspf"%>
<link rel="stylesheet" href="${ctx}/css/layui.css"  media="all">	
<link rel="stylesheet" href="${ctx}/css/laydate.css"  media="all">	
<link rel="stylesheet" href="${ctx}/css/promotion/promotion.css"  media="all">	
<script type="text/javascript" src="${ctx}/js/promotion/detail/add.js"></script>
<script>
	layui.use('laydate', function(){
	  var laydate = layui.laydate;
	  
	  var start = {
	    min: laydate.now()
	    ,max: '2099-06-16 23:59:59'
	    ,istoday: false
	    ,choose: function(datas){
	      end.min = datas; //开始日选好后，重置结束日的最小日期
	      end.start = datas //将结束日的初始值设定为开始日
	    }
	  };
	  
	  var end = {
	    min: laydate.now()
	    ,max: '2099-06-16 23:59:59'
	    ,istoday: false
	    ,choose: function(datas){
	      start.max = datas; //结束日选好后，重置开始日的最大日期
	    }
	  };
	  $('#LAY_demorange_s').onclick = function(){
		 alert(1);
	    start.elem = this;
	    laydate(start);
	  }
	  $('#LAY_demorange_e').onclick = function(){
		  alert(2);
	    end.elem = this
	    laydate(end);
	  } 
	  
	});
</script>
<style type="text/css">
.col-sm-3 {
	width: 15%;
	float: left;
	text-align: right;
}

.col-sm-9 {
	width: 85%;
	float: left;
	text-align: left;
}

label[class^="btn btn-default"] {
	margin-top: -4px;
}
</style>
</head>
<body>
	<div class="l_err" style="width: 100%; margin-top: 2px;"></div>
	<form id="form" name="form" class="form-horizontal" method="post" style="width:95%;margin-left: 25px;"
		action="${ctx}/promotion/detail/addEntity">
		<section class="panel panel-default">
		<div class="panel-body">
			<div class="form-group">
				<label class="col-sm-3 control-label">促销类型</label>
				<div class="col-sm-9">
					<select class="form-control" onchange="proTypeOnchang(this)" name="pro_type" id="pro_type">
						<option value="-1" selected="selected" >请选择</option>
						<option value="0" >订单满减</option>
						<option value="1" >商品满减</option>
						<option value="2" >商品满赠</option>
						<option value="3" >商品打折</option>
					</select>
				</div>
			</div>
			<div class="line line-dashed line-lg pull-in"></div>
			<div class="form-group">
				<label class="col-sm-3 control-label">促销活动</label>
				<div class="col-sm-9">
					<select id="pro_id" name="pro_id"  onchange="proIdOnchang(this)" class="form-control m-b"
						tabindex="-1">
					</select>
				</div>
			</div>
			<div class="line line-dashed line-lg pull-in"></div>
			<div class="form-group">
				<label class="col-sm-3 control-label">促销开始时间</label>
				<div class="col-sm-9" style="color: red;">
					<input class="layui-input" name="pro_start" disabled="disabled" id="LAY_demorange_s" onclick="layui.laydate({elem: this, istime: true, format: 'YYYY-MM-DD hh:mm:ss'})"><!-- onclick="layui.laydate({elem: this, istime: true, format: 'YYYY-MM-DD hh:mm:ss'})" -->
				</div>
			</div>
			<div class="line line-dashed line-lg pull-in"></div>
			<div class="form-group">
				<label class="col-sm-3 control-label">促销结束时间</label>
				<div class="col-sm-9" style="color: red;">
					<input class="layui-input" name="pro_end" id="LAY_demorange_e" disabled="disabled"  onclick="layui.laydate({elem: this, istime: true, format: 'YYYY-MM-DD hh:mm:ss'})"><!-- onclick="layui.laydate({elem: this, istime: true, format: 'YYYY-MM-DD hh:mm:ss'})" -->
				</div>
			</div>
		</div>
		<div class="line line-dashed line-lg pull-in orderSalesAmount" style="display:none" ></div>	
		<div class="form-group orderSalesAmount"  id="orderSalesAmount" style="display:none">
			<div class="col-sm-3">
				<label class="control-label">订单满减(￥)</label>
			</div>
			<div class="col-sm-9">
				<div class="col-sm-1">
					<label class="control-label"><font color="red">购买金额≥</font></label>
				</div>
				
				<div class="col-sm-5">
				    <input class="form-control" placeholder="请输入金额" name="pro_money_m" id="pro_money_m" type="text">		
				</div>
				<div class="col-sm-1">
					<label class="control-label"><font color="red">减</font></label>
				</div>
				<div class="col-sm-4">
				     <input class="form-control" placeholder="请输入减少金额" name="pro_money_s" id="pro_money_s" type="text">
				</div>		
				<div class="col-sm-1">
				   <label class="control-label"><font color="red">元</font></label>
				</div>
			</div>
		</div>
		<div class="line line-dashed line-lg pull-in productsReduction" style="display:none"></div>	
		<div class="form-group productsReduction" id ="productsReduction" style="display:none">
			<div class="col-sm-3">
				<label class="control-label">商品满减(￥)</label>
			</div>
			<div class="col-sm-9">
				<div class="col-sm-1">
					<label class="control-label"><font color="red">购买金额≥</font></label>
				</div>
				
				<div class="col-sm-5">
				    <input class="form-control" placeholder="请输入购买金额" name="pro_money_m_mj" id="pro_money_m_mj" type="text">		
				</div>
				<div class="col-sm-1">
					<label class="control-label"><font color="red">减</font></label>
				</div>
				<div class="col-sm-4">
				     <input class="form-control" placeholder="请输入减少金额" name="pro_money_s_mj" id="pro_money_s_mj" type="text">
				</div>				
				<div class="col-sm-1">
				   <label class="control-label"><font color="red">元</font></label>
				</div>
			</div>
		</div>
		<div class="line line-dashed line-lg pull-in productsGift" style="display:none"></div>	
		<div class="form-group productsGift" id ="productsGift" style="display:none">
			<div class="col-sm-3">
				<label class="control-label">商品满赠(个)</label>
			</div>
			<div class="col-sm-9">
				<div class="col-sm-1">
					<label class="control-label"><font color="red">购买数量≥</font></label>
				</div>
				
				<div class="col-sm-5">
				    <input class="form-control" placeholder="请输入商品数量" name="pro_count_m" id="pro_count_m_mz" type="text">		
				</div>
				<div class="col-sm-1">
					<label class="control-label"><font color="red">送</font></label>
				</div>
				<div class="col-sm-4">
				     <input class="form-control" placeholder="请输入赠送数量" name="pro_count_s" id="pro_count_s_mz" type="text">
				</div>		
				<div class="col-sm-1">
				   <label class="control-label"><font color="red">个</font></label>
				</div>
			</div>
		</div>
	<!-- 	<div class="line line-dashed line-lg pull-in proDiscountRate" style="display:none"></div>
		<div class="form-group proDiscountRate" id="proDiscountRate" style="display:none">
			<div class="col-sm-3">
				<label class="control-label">促销折扣率(%)</label>
			</div>
			<div class="col-sm-9">
			   <div class="input-group spinner">  
			    <input type="text" class="form-control" name="pro_rate" id="pro_rate" value="100"  placeholder="请输入折扣率">
			    <div class="input-group-btn-vertical">  
			      <button class="btn btn-default" type="button" id="addRate"><i class="fa fa-caret-up"></i></button>  
			      <button class="btn btn-default" type="button" id="subRate"><i class="fa fa-caret-down"></i></button>  
			    </div>  
			  </div>  
			</div>
		</div> -->
		<div class="line line-dashed line-lg pull-in freeGoods" style="display:none"></div>	
		<div class="form-group freeGoods" id="freeGoods"  style="display:none">
			<div class="col-sm-3"> 
				<label class="control-label">选择赠送商品</label>
			</div>
			<div class="col-sm-9">
			    <button class="btn btn-info" type="button" id="selectGoods"  >选择赠送商品</button> 
			</div>
		</div>
		<div class="form-group freeGoods"  style="display:none">
			<div class="col-sm-3"> 
				<label class="control-label">商品列表</label>
			</div>
			<div class="col-sm-9">
				 <input type="hidden"  name ="pro_goods" id="pro_goods" value=""/>
				<ul class="list-group"  id="prodctsitems">
				   <!--  <li class="list-group-item"><button class="btn badge" type="button" id="pro_goods" >删除</button>商品名称：环奇630遥控车 </li>
				    <li class="list-group-item"><button class="btn badge" type="button" id="pro_goods" >删除</button>商品名称：环奇630遥控车</li>
				    <li class="list-group-item"><button class="btn badge" type="button" id="pro_goods" >删除</button>商品名称：环奇630遥控车</li>
				    <li class="list-group-item"><button class="btn badge" type="button" id="pro_goods" >删除</button> 商品名称：环奇630遥控车</li>
				    <li class="list-group-item"><button class="btn badge" type="button" id="pro_goods" >删除</button>商品名称：环奇630遥控车</li>
				    <li class="list-group-item"><button class="btn badge" type="button" id="pro_goods" >删除</button> 商品名称：环奇630遥控车</li> -->
				</ul>  
			</div>
		</div>
		<div class="line line-dashed line-lg pull-in proDiscountRate" style="display:none"></div>	
		<div class="form-group proDiscountRate" id ="proDiscountRate" style="display:none">
			<div class="col-sm-3">
				<label class="control-label">商品打折(%)</label>
			</div>
			<div class="col-sm-9">
				<div class="col-sm-1">
					<label class="control-label"><font color="red">购买数量≥</font></label>
				</div>				
				<div class="col-sm-5">
				    <input class="form-control" placeholder="请输入商品数量" name="pro_count_m_dz" id="pro_count_m_dz" type="text">		
				</div>
				<div class="col-sm-1">
					<label class="control-label"><font color="red">促销折扣率</font></label>
				</div>				
				<div class="col-sm-4">
				    <div class="input-group spinner">  
				    <input type="text" class="form-control" name="pro_rate" id="pro_rate" value="100"  placeholder="请输入折扣率">
				    <div class="input-group-btn-vertical">  
				      <button class="btn btn-default" type="button" id="addRate"><i class="fa fa-caret-up"></i></button>  
				      <button class="btn btn-default" type="button" id="subRate"><i class="fa fa-caret-down"></i></button>  
				    </div>  
				  </div>  	
				</div>				
				<div class="col-sm-1">
					<label class="control-label"><font color="red">%</font></label>
				</div>	
			</div>
		</div>		
		<div class="line line-dashed line-lg pull-in"></div>	
		<div class="form-group">
			<div class="col-sm-3">
				<label class="control-label">促销说明</label>
			</div>
			<div class="col-sm-9">				
				<textarea rows="5" cols="100"   placeholder="请输入促销说明" name="ext" id="ext"></textarea>
			</div>
		</div>
		<div class="line line-dashed line-lg pull-in"></div>	
		<div class="form-group">
			<div class="col-sm-3">
				<label class="control-label">促销备注</label>
			</div>
			<div class="col-sm-9">				
				<textarea rows="5" cols="100"    placeholder="请输入促销备注" name="ext1" id="ext1"></textarea>
			</div>
		</div>
		<footer class="panel-footer text-center bg-light lter">
		<button type="submit" class="btn btn-success btn-s-xl">保存</button>
		</footer> </section>
	</form>
	
	<script type="text/javascript">
	onloadurl();
	</script>
	<script type="text/javascript"
		src="${ctx}/js/jquery/bootstrap-filestyle.min.js"></script>
</body>
</html>